#include <iostream>
#include <windows.h> 
using namespace std;
const double inf=0x7fffffff;
int time=1;


double func(double x,double a,double b,double c){
	return a*x*x+b*x+c;
}



int main(){
	int n;
	cin>>n;
	double a,b,c;
	cin>>a>>b>>c;
	double l,r;
	cin>>l>>r;
	double x[n];
	double y[n];
	do{
		cout<<"["<<time<<"]"<<endl;
		time++;
		for(int i=1;i<=n;i++)
			x[i-1] = i*(r-l)/n+l;
		for(int i=0;i<n;i++)
			y[i] = func(x[i],a,b,c);
		double min=inf;
		int index=-1;
		for(int i=0;i<n;i++){
			if(y[i] < min){
				index = i+1;
				min = y[i];
			}
		}
		double left,right;
		left = (index-1)*(r-l)/n+l;
		right = (index+1)*(r-l)/n+l;
		l = left;
		r = right;
		cout<<l<<" "<<r<<endl;
	}while(r-l > 0.001);
	cout<<l;
	system("pause");
	return 0;
}
